package com.newgrand.domain.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @创建人：ZhaoFengjie
 * @修改人：ZhaoFengjie
 * @创建时间：15:49 2022/10/11
 * @修改时间:：15:49 2022/10/11
 */
@Data
@ApiModel(value = "Reconciliation", description = "对账单数据模型")
public class Reconciliation {

    @ApiModelProperty(value = "对账单数据列表")
    private List<ReconciliationData> data;

    @Data
    @ApiModel(value = "ReconciliationData", description = "对账单表头数据模型")
    public class ReconciliationData {
        @ApiModelProperty(value = "组织机构id")
        private Long id;
        @ApiModelProperty(value = "对账人")
        private String accountor;
        @ApiModelProperty(value = "制单人")
        private String maker;
        @ApiModelProperty(value = "备注")
        private String remark;
        @ApiModelProperty(value = "版本")
        private Long version;
        @ApiModelProperty(value = "组织机构id")
        private Long orgId;
        @ApiModelProperty(value = "组织机构名称")
        private String orgName;
        @ApiModelProperty(value = "入账时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date recordedDate;
        @ApiModelProperty(value = "单据编码")
        private String orderCode;
        @ApiModelProperty(value = "供应商名称")
        private String supplierName;
        @ApiModelProperty(value = "供应商Id")
        private Long supplierId;
        @ApiModelProperty(value = "供应商对接")
        private String oriSupplierId;
        @ApiModelProperty(value = "机构对接")
        private String oriOrgId;
        @ApiModelProperty(value = "对接收料单ID")
        private String oriOrderId;
        @ApiModelProperty(value = "对账方式")
        private Integer checkWay;
        @ApiModelProperty(value = "合同Id")
        private Long contractId;
        @ApiModelProperty(value = "合同Code")
        private String contractCode;
        @ApiModelProperty(value = "合同名称")
        private String contractName;
        @ApiModelProperty(value = "对账时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date accountTim;
        @ApiModelProperty(value = "对账状态")
        private Boolean accountState;
        @ApiModelProperty(value = "不含税金额")
        private Long taxFreeSum;
        @ApiModelProperty(value = "含税金额")
        private Double taxIncludedSum;
        @ApiModelProperty(value = "税额")
        private Double taxAmount;
        @ApiModelProperty(value = "创建人id")
        private Long creatorId;
        @ApiModelProperty(value = "创建人名称")
        private String creatorName;
        @ApiModelProperty(value = "修改人id")
        private Long modifierId;
        @ApiModelProperty(value = "创建人名称")
        private String modifierName;
        @ApiModelProperty(value = "单据日期")
        private String orderDate;
        @ApiModelProperty(value = "入账状态")
        private Integer entryState;
        @ApiModelProperty(value = "打印次数")
        private Integer prIntegerTimes;
        @ApiModelProperty(value = "创建时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date createdAt;
        @ApiModelProperty(value = "修改时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date updatedAt;
        @ApiModelProperty(value = "")
        private Boolean isRemoved;
        @ApiModelProperty(value = "对接第三方合同Id")
        private String oriContractId;
        @ApiModelProperty(value = "对接第三方合同Code")
        private String oriContractCode;
        @ApiModelProperty(value = "对接第三方合同名称")
        private String oriContractName;
        @ApiModelProperty(value = "清单")
        private List<ReconciliationItem> items;
    }

    @Data
    @ApiModel(value = "ReconciliationItem", description = "对账单清单数据模型")
    public class ReconciliationItem {
        @ApiModelProperty(value = "主键")
        private Long id;
        @ApiModelProperty(value = "数量")
        private Double quantity;
        @ApiModelProperty(value = "生产厂商")
        private String manufacturer;
        @ApiModelProperty(value = "版本号")
        private Long version;
        @ApiModelProperty(value = "组织机构id")
        private Long orgId;
        @ApiModelProperty(value = "主表id")
        private Long orderId;
        @ApiModelProperty(value = "组织机构名称")
        private String orgName;
        @ApiModelProperty(value = "业务类型（新增） 调入（20） 收料（10） 调入退（-21） 收料退（-11）预点（30）")
        private Integer serviceType;
        @ApiModelProperty(value = "操作类型（新增） -1冲红（不考虑预点） 2补录 4正常 -2冲预点（只考虑预点业务）")
        private Integer orderType;
        @ApiModelProperty(value = "主材主键")
        private Long materialId;
        @ApiModelProperty(value = "材料编码")
        private String materialCode;
        @ApiModelProperty(value = "材料名称")
        private String materialName;
        @ApiModelProperty(value = "规格型号")
        private String materialModel;
        @ApiModelProperty(value = "主单位")
        private String materialUnit;
        @ApiModelProperty(value = "税率")
        private Double taxRate;
        @ApiModelProperty(value = "不含税单价")
        private Double taxFreePrice;
        @ApiModelProperty(value = "不含税金额")
        private Double taxFreeSum;
        @ApiModelProperty(value = "含税单价")
        private Double taxIncludedPrice;
        @ApiModelProperty(value = "含税金额")
        private Double taxIncludedSum;
        @ApiModelProperty(value = "炉批号")
        private String batchNo;
        @ApiModelProperty(value = "存放地")
        private String storagePlace;
        @ApiModelProperty(value = "")
        private String infoRemark;
        @ApiModelProperty(value = "批次号")
        private String orderBarCode;
        @ApiModelProperty(value = "入账状态")
        private Boolean entryState;
        @ApiModelProperty(value = "备注")
        private String itemRemark;
        @ApiModelProperty(value = "材料信息varchar主键")
        private String oriMaterialId;
        @ApiModelProperty(value = "实际供应商名称")
        private String actualSupplierName;
        @ApiModelProperty(value = "实际供应商Id")
        private Long actualSupplierId;
        @ApiModelProperty(value = "供应商对接")
        private String oriActualSupplierId;
        @ApiModelProperty(value = "")
        private String sortCode;
        @ApiModelProperty(value = "")
        private Long creatorId;
        @ApiModelProperty(value = "")
        private String creatorName;
        @ApiModelProperty(value = "")
        private String modifierId;
        @ApiModelProperty(value = "")
        private String modifierName;
        @ApiModelProperty(value = "")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date createdAt;
        @ApiModelProperty(value = "")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date updatedAt;
        @ApiModelProperty(value = "")
        private Boolean isRemoved;
        @ApiModelProperty(value = "单据类型标记")
        private Integer typeMark;
    }
}
